package com.king.service;


import com.king.dao.UserDao;

public class UserServiceImp implements UserService {

    //原始的做法,每次改变都需要重新new 一个dao层对象
    //private UserDao userDao=new UserDaoMySql();

    //改进后的做法,不直接new dao层对象，利用set方法动态植入
    private UserDao userDao;

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    public void getUSer() {
        userDao.select();
    }
}
